package com.xjl.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xjl.demo.WebInfo;
import com.xjl.service.WebinfoService;
import com.xjl.service.impl.WebinfoServiceImpl;
@WebServlet("/showweb.do")
public class ShowWebinfoServlet extends HttpServlet {
	
	WebinfoService wb = new WebinfoServiceImpl();
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		//设置请求编码格式
		req.setCharacterEncoding("utf-8");
		//设置响应编码格式
		resp.setContentType("text/html;utf-8");
		
		WebInfo info = wb.SelectWebinfoService();
		req.setAttribute("info", info);
		req.getRequestDispatcher("admin/showinfo.jsp").forward(req, resp);
	}
}
